<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>所有元素</title>
</head>
<body>
    <div id="div1">
        <p>什么是JavaScript </p> 
        <p>JavaScript是一门功能强大的编程语言</p>
        <h1>一起来学习JavaScri程序设计</h1>
        <hr/>  
        <p>JavaScript的发展历史</p>
    </div>
<script>
    function delp(){

        var child=document.getElementsByTagName("p");
        for(var i=0;i<child.length;i++) { 
            child[i].parentNode.removeChild(child[i]);
    }
    }
</script>
    <input type="button" value="删除所有的p元素" onclick="delp()"/>
</body>
</html>